#pragma once

template<class T>
class AutoFree
{
public:
	AutoFree(T* ptr):_ptr(ptr){}
	~AutoFree()
	{
		delete _ptr;
	}
	T* operator->()
	{
		return _ptr;
	}
protected:
	T * _ptr;
};